package com.vinobase.model.bean;

import com.googlecode.objectify.annotation.Entity;

import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;


@Entity
public class Appellation {

    @Id
    private Long id;

    @NotNull
	@Size(min=1, max=25)
    private String name;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }




    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Appellation appellation = (Appellation) o;

        if (id != null ? !id.equals(appellation.id) : appellation.id != null) return false;
        if (name != null ? !name.equals(appellation.name) : appellation.name != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }
}
